package happywing.client.widget;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;

public class PlatformView extends Composite {
	private LayoutPanel body;
	
	public PlatformView(){
		FlowPanel navi=initNavi();
		body=new LayoutPanel();
		Image backgroundImage = new Image();
		
		backgroundImage.setUrl("/images/loginbg.jpg");
	    backgroundImage.setWidth("100%");
	    backgroundImage.setHeight("100%");
		
	    body.setStyleName("platform-body");
		
		LayoutPanel panel=new LayoutPanel();
		panel.add(backgroundImage);
		panel.add(body);
		panel.add(navi);
		
		panel.setWidgetTopHeight(navi, 0, Unit.PX, 50, Unit.PX);

		initWidget(panel);
	}
	
	public LayoutPanel getBodyPanel(){
		return this.body;
	}
	
	private FlowPanel initNavi(){
		FlowPanel naviPanel=new FlowPanel();
		naviPanel.setStyleName("platform-navi");
		
		Image menuButton = new Image();
		menuButton.setUrl("/images/platform-navi_MenuButton.png");
		Anchor menuButtonAnchor=new Anchor();
		menuButtonAnchor.getElement().appendChild(menuButton.getElement());
		menuButtonAnchor.setStyleName("platform-navi-MenuButton platform-navi-ico");
		
		Image button1 = new Image();
		button1.setUrl("/images/platform-navi_05-03.png");
		Anchor button1Anchor=new Anchor();
		button1Anchor.getElement().appendChild(button1.getElement());
		button1Anchor.setStyleName("platform-navi-ico");
		
		Image button2 = new Image();
		button2.setUrl("/images/platform-navi_05-04.png");
		Anchor button2Anchor=new Anchor();
		button2Anchor.getElement().appendChild(button2.getElement());
		button2Anchor.setStyleName("platform-navi-ico");
		
		Image button3 = new Image();
		button3.setUrl("/images/platform-navi_05-05.png");
		Anchor button3Anchor=new Anchor();
		button3Anchor.getElement().appendChild(button3.getElement());
		button3Anchor.setStyleName("platform-navi-ico");
		
		Image buttonHome = new Image();
		buttonHome.setUrl("/images/platform-navi_home.png");
		Anchor buttonHomeAnchor=new Anchor();
		buttonHomeAnchor.getElement().appendChild(buttonHome.getElement());
		buttonHomeAnchor.setStyleName("platform-navi-ico platform-navi-home");
		
		FlowPanel pathPanel=new FlowPanel();
		pathPanel.setStyleName("platform-navi-path");
		
		Image pathImg = new Image();
		pathImg.setUrl("/images/platform-navi_05-03.png");
		Anchor pathImgAnchor=new Anchor();
		pathImgAnchor.getElement().setInnerHTML(pathImg.toString()+"时间计划 >");
		pathImgAnchor.setStyleName("");
		
		Image pathImg2 = new Image();
		pathImg2.setUrl("/images/platform-navi_05-06.png");
		Anchor pathImgAnchor2=new Anchor();
		pathImgAnchor2.getElement().setInnerHTML(pathImg2.toString()+"时间计划 详情");
		pathImgAnchor2.setStyleName("");
		
		pathPanel.add(pathImgAnchor);
		pathPanel.add(pathImgAnchor2);
		
		
		Image buttonBack = new Image();
		buttonBack.setUrl("/images/platform-navi_back.png");
		buttonBack.setHeight("35px");
		Anchor buttonBackAnchor=new Anchor();
		buttonBackAnchor.getElement().appendChild(buttonBack.getElement());
		buttonBackAnchor.setStyleName("platform-navi-back");
		
	    
		naviPanel.add(menuButtonAnchor);
		naviPanel.add(button1Anchor);
		naviPanel.add(button2Anchor);
		naviPanel.add(button3Anchor);
		naviPanel.add(buttonHomeAnchor);
		naviPanel.add(pathPanel);
		
		naviPanel.add(buttonBackAnchor);
		
		
		return naviPanel;
	}
}
